<template>
  <div>
    <van-tabbar v-model="active" route>
      <van-tabbar-item icon="home-o" to="/home">首页</van-tabbar-item>
      <van-tabbar-item icon="balance-list-o" to="/recommend"
        >种草文章</van-tabbar-item
      >
      <van-tabbar-item
        icon="cart-o"
        to="/cart"
        replace
        :badge="cartStore.count.toString()"
        >购物车</van-tabbar-item
      >
      <van-tabbar-item icon="user-o" to="/user" replace>我的</van-tabbar-item>
    </van-tabbar>
  </div>
</template>

<script setup>
import { ref } from "vue";
import useCartInfo from "@/store/useCartInfo";
let cartStore = useCartInfo();

/**
 * 选中index
 */
const active = ref(0);
</script>

<style scoped>
</style>
